class Solution {
public:
    bool isPalindrome(string s) {
        string::iterator it = s.begin();
        string str;
        while(it < s.end())
        {
            if((*it >= 'a' && *it <='z')||('0'<=*it && *it<='9'))
            {
                str+=*it;
            }
            else if(*it >= 'A' && *it <= 'Z')
            {
                str+= ((*it-'A')+'a');
            }
            ++it;
        }
      // cout<<endl<<str<<endl;
        string::iterator start = str.begin();
        string::iterator end = str.end()-1;
        while(start <= end)
        {
            if(*start != *end)
            {
        //        cout<<*start<<" "<<*end<<endl;
                return false;
            }
            ++start;
            --end;
        }
        return true;
    }
};
